import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token: null,
  },
  getters: {
  },
  mutations: {
    SET_TOKEN(state, token) {
      state.token = token;
      localStorage.setItem('token', token)
    },
    RESET_STATE(state, token) {
      state.token = null;
      localStorage.clear();
      sessionStorage.clear();
    },
  },
  actions: {
  },
  modules: {
  }
})
